package com.bugpool.leilema.tc.bean.enums;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author wh
 * @Description 状态枚举
 * @Date 2023/3/6 8:52
 * @Version 1.0
 **/
public enum StatusEnum {


    NORMAL("0", "启用"),
    DISABLE("1", "禁用");

    private static Map<String, StatusEnum> map = new ConcurrentHashMap<>();

    static {
        for (StatusEnum value : StatusEnum.values()) {
            map.put(value.getCode(), value);
        }
    }


    private String code;

    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    StatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static StatusEnum getStatusEnum(String code) {
        return map.get(code);
    }

}
